
package requests

import (
	"github.com/goravel/framework/contracts/http"
	"github.com/goravel/framework/contracts/validation"
)

type OutInterfaceRequest struct {

	Pid string `json:"pid" form:"pid"`

	Type string `json:"type" form:"type"`

	Name string `json:"name" form:"name"`

	Describe string `json:"describe" form:"describe"`

	Method string `json:"method" form:"method"`

	Url string `json:"url" form:"url"`

	RequestParams string `json:"request_params" form:"request_params"`

	ReturnParams string `json:"return_params" form:"return_params"`

	RequestExample string `json:"request_example" form:"request_example"`

	ReturnExample string `json:"return_example" form:"return_example"`

	ErrorCode string `json:"error_code" form:"error_code"`

	IsDel string `json:"is_del" form:"is_del"`

}

func (r *OutInterfaceRequest) Authorize(ctx http.Context) error {
	return nil
}

func (r *OutInterfaceRequest) Rules(ctx http.Context) map[string]string {
	return map[string]string{

		"pid": "required",

		"type": "required",

		"name": "required",

		"describe": "required",

		"method": "required",

		"url": "required",

		"request_params": "required",

		"return_params": "required",

		"request_example": "required",

		"return_example": "required",

		"error_code": "required",

		"is_del": "required",

	}
}

func (r *OutInterfaceRequest) Messages(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *OutInterfaceRequest) Attributes(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *OutInterfaceRequest) PrepareForValidation(ctx http.Context, data validation.Data) error {
	return nil
}
